home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
doom
/
cddk9605.zip
/
HEADERS.ARJ
/
IO.INT
< prev
next >
Wrap
Text File
|
1996-05-17
|
24KB
|
715 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ Name : IO.PAS }
{ Description : Concerto Input/Output Engine }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT IO;
{ (outbound characters) }
{ ││ }
{ ┌─────┴┴─────┐ }
{ │ Zero-State │ }
{ │ Driver │ }
{ └─┬────────┬─┘ ┌────────┐ }
{ │ │ ┌───────>│ Driver │ (FOSSIL) }
{ (HotChar) (Other) │ └────────┘ }
{ │ │ │ ┌────────┐ }
{ ┌────────┴─┐ │ ┌───────────┴┐ ┌─>│ Driver │ (CRT) }
{ │ External │ └───>│ Driver ├────┘ └────────┘ }
{ │ Driver ├──────────>│ Collection ├────┐ ┌────────┐ }
{ └──────────┘ └───────────┬┘ └─>│ Driver │ (ImageLog) }
{ │ └────────┘ }
{ │ ┌────────┐ }
{ └───────>│ Driver │ (Other) }
{ └────────┘ }
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
USES
Objects;
CONST
MaxStateDrivers = 50;
TYPE
tColorScheme = RECORD
Lower : Byte; { . . . . . . . . Lower case letters }
Upper : Byte; { . . . . . . . . Upper case letters }
Digit : Byte; { . . . . . . . . . Digits (numbers) }
HiBit : Byte; { . . . IBM Extended ASCII characters }
Punct : Byte; { . Punctuation and misc. characters }
END;
pColorScheme = ^tColorScheme;
{ ┌─────────────────────────────────────────────────────────────────────┐ }
{ │▒▒▒ tIODriver ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
{ └─────────────────────────────────────────────────────────────────────┘ }
{ }
{ The I/O Driver is one of the fundamental concepts of Concerto. The }
{ stream of outbound characters is multiplexed (sprinkled) through all of }
{ the I/O drivers registered with the system. Each I/O driver is merely a }
{ descendent of tIODriver. }
tIODriver = OBJECT(tObject)
Active : Boolean; { . . Is this driver currently active? }
NameCRC : LongInt; { The 32-bit CRC of the driver's name. }
CONSTRUCTOR Init(p:pChar);
{ Default behavior of each method }
{ }
{ Abstract : run-time error 211 }
{ Ignore : no operation }
{ Other : calls other methods }
PROCEDURE ClrEOL; VIRTUAL; { Ignore }
PROCEDURE ClrScr; VIRTUAL; { Ignore }
PROCEDURE Color(c:Byte); VIRTUAL; { Ignore }
PROCEDURE CursorDown(n:Byte); VIRTUAL; { Ignore }
PROCEDURE CursorLeft(n:Byte); VIRTUAL; { Ignore }
PROCEDURE CursorRight(n:Byte); VIRTUAL; { Ignore }
PROCEDURE CursorUp(n:Byte); VIRTUAL; { Ignore }
PROCEDURE GotoXY(x,y:Byte); VIRTUAL; { Ignore }
PROCEDURE Home; VIRTUAL; { Other }
PROCEDURE PurgeInbound; VIRTUAL; { Ignore }
PROCEDURE PurgeOutbound; VIRTUAL; { Ignore }
PROCEDURE ReadChar(VAR c:Char); VIRTUAL; { Abstract }
PROCEDURE SendChar(c:Char); VIRTUAL; { Abstract }
PROCEDURE SendData(p:Pointer; s:Word); VIRTUAL; { Other }
PROCEDURE SendpChar(p:pChar); VIRTUAL; { Other }
PROCEDURE SendString(CONST s:OpenString); VIRTUAL; { Other }
FUNCTION Waiting:Boolean; VIRTUAL; { Abstract }
END;
pIODriver = ^tIODriver;
{ ┌─────────────────────────────────────────────────────────────────────┐ }
{ │▒▒▒ tIODriverTextGfx ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
{ └─────────────────────────────────────────────────────────────────────┘ }
{ This descendent of tIODriver overrides the color/cursor procedures. }
{ The calls are converted to ASCII/ANSI/AVATAR text codes. }
tIODriverTextGfx = OBJECT(tIODriver)
Graphics : Byte;
PROCEDURE ClrEOL; VIRTUAL;
PROCEDURE ClrScr; VIRTUAL;
PROCEDURE Color(c:Byte); VIRTUAL;
PROCEDURE CursorLeft(n:Byte); VIRTUAL;
PROCEDURE CursorRight(n:Byte); VIRTUAL;
PROCEDURE GotoXY(x,y:Byte); VIRTUAL;
END;
pIODriverTextGfx = ^tIODriverTextGfx;
{ ┌─────────────────────────────────────────────────────────────────────┐ }
{ │▒▒▒ tIODriverRemote ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
{ └─────────────────────────────────────────────────────────────────────┘ }
{ }
{ This object provides additional support for I/O drivers used in a }
{ communications setting. You will still need to override the IO- }
{ specific methods. Since many remote terminals use ANSI and other color }
{ protocols, this object is a descendent of tIODriverTextGfx. }
tIODriverRemote = OBJECT(tIODriverTextGfx)
Baud : LongInt;
ComPort : Word;
Locked : LongInt;
CONSTRUCTOR Init(p:pChar; c:Word; b,l:LongInt);
FUNCTION CarrierDetect:Boolean; VIRTUAL;
PROCEDURE LowerDTR; VIRTUAL;
PROCEDURE RaiseDTR; VIRTUAL;
PROCEDURE SetBaud(b,l:LongInt); VIRTUAL;
END;
pIODriverRemote = ^tIODriverRemote;
{ ┌─────────────────────────────────────────────────────────────────────┐ }
{ │▒▒▒ tStateDriver ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ │ }
{ └─────────────────────────────────────────────────────────────────────┘ }
{ The state driver system allows you to install any color protocol without
recompiling the IO unit. This system will be documented in the next
release. }
tStateDriver = RECORD
Active : Boolean; { . . . . . Is this state driver active? }
Handler : PROCEDURE (c:Char); { . . Who gets the stream of characters? }
NameCRC : LongInt; { The 32-bit CRC of the driver's family. }
END;
pStateDriver = ^tStateDriver;
CONST
ColorScheme : pColorScheme = NIL; { . . . . . Current color scheme }
DBS : Boolean =